package com.srwl.mytx.activity;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import com.srwl.mytx.R;
import com.srwl.mytx.fragment.ChangeFragment;
import com.srwl.mytx.widget.RPTitleBar;

/**
 * Created by max on 16/2/26
 * 钱包
 */
public class ChangeActivity extends BaseActivity {


    private RPTitleBar mTitleBar;

    @Override
    protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        setContentView(R.layout.rp_activity_change);

        initViewsAndEvents();
    }

    //必须重写，不然状态栏字体是黑色，，
    protected void setStatusDark() {
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.setStatusBarColor(getResources().getColor(R.color.rp_top_red_color));
    }

    protected void initViewsAndEvents() {
        getSupportFragmentManager().beginTransaction().add(R.id.change_fragment_container, new ChangeFragment()).commit();

        mTitleBar = findViewById(R.id.change_title_bar);
        mTitleBar.setLeftLayoutClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                hideSoftKeyboard();
                finish();
            }
        });


        setSubTitle(mTitleBar);
        mTitleBar.setRightImageLayoutVisibility(View.GONE);
        // onRetryToken(null);
    }

    private void setSubTitle(RPTitleBar titleBar) {
        if (titleBar == null) {
            return;
        }
        titleBar.setSubTitleVisibility(View.GONE);//标题栏小标题 gone

    }


    @Override
    protected void onDestroy() {
        super.onDestroy();

    }
}
